﻿<%@ Page Title="询盘列表页" Language="C#" MasterPageFile="~/MasterPage/Main.master" AutoEventWireup="true" CodeFile="list.aspx.cs" Inherits="buylead_list" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<asp:Content ID="Content1" ContentPlaceHolderID="headcss" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<div class="ListHead">
    <h3>Buylead List</h3>
</div>
<table style="width: 100%;" class="queryTable">
    <tr>
        <th style="width: 10%">Subject</th>
        <td style="width: 10%"><asp:TextBox ID="txtSubject" MaxLength="150" runat="server" Width="150px" CssClass="textbox"></asp:TextBox></td>
        <th style="width: 10%">CompanyName：</th>
        <td style="width: 10%"><asp:TextBox ID="txtCompanyName" MaxLength="200" runat="server" Width="150px" CssClass="textbox"></asp:TextBox></td>
        <th style="width:10%">Email</th>
        <td><asp:TextBox ID="txtEmail" MaxLength="200" runat="server" Width="150px" CssClass="textbox"></asp:TextBox></td>
        <th style="width:10%">AuditStatus</th>
        <td><asp:DropDownList ID="ddpStatus" runat="server" Width="155px" CssClass="select">
                <asp:ListItem Selected="True" Value="">Please Select</asp:ListItem>
                <asp:ListItem Value="1">New</asp:ListItem>
                <asp:ListItem Value="2">Approve</asp:ListItem>
                <asp:ListItem Value="4">Revise</asp:ListItem>
                <asp:ListItem Value="16">Reject</asp:ListItem>
            </asp:DropDownList></td>
    </tr> 
    <tr>
        <th style="width: 10%">CreateDate</th>
        <td colspan="7" style="width: 90%">
        <asp:TextBox ID="txtStartTime" MaxLength="20" runat="server" Width="150px" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" CssClass="textbox"></asp:TextBox>
        -
        <asp:TextBox ID="txtEndTime" MaxLength="20" runat="server" Width="150px" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" CssClass="textbox"></asp:TextBox>
        </td>
    </tr>
    <tr>
    <td colspan="8" align="center">    
        <%--<input id="btnAdd" class="btn" onclick="openDetail(0)" type="button" value="新增" />--%>
        <asp:Button ID="btnSerach" CssClass="btn" class="btn" OnClick="btnSerach_Click" runat="server"  Text="查询" /></td>
    </tr>
</table>
<table cellpadding="0" cellspacing="1" border="0" class="TableList">
    <tr>
        <th style="width:80px;">BuyleadID</th>
        <th>Subject</th>
        <th>CompanyName</th>
        <th>Email</th>
        <th style="width:80px;">AuditStatus</th>
        <th style="width:130px">CreateDate</th>
        <th style="width:110px;">Action</th>
    </tr>
    <%if (BuyleadList != null && BuyleadList.Count > 0)
      { %>
    <%foreach (var buylead in BuyleadList)
      { %>
    <tr>
        <td><%=buylead.BuyleadID%></td>
        <td><%=buylead.Subject%></td>
        <td><%=buylead.CompanyName%></td>
        <td><%=buylead.Email%></td>
        <td><%=buylead.viewAuditStatus%></td>
        <td style="text-align:center;"><%=buylead.viewCreateDate%></td>
        <td style="text-align:center;"><a href="javascript:" onclick="openDetail(<%=buylead.BuyleadID %>)">Edit</a>&nbsp;&nbsp;<a href="javascript:" onclick="deleteBuylead(<%=buylead.BuyleadID %>)">Delete</a></td>
    </tr>
    <%} %>
    <%} %>
</table>
<table style="width: 100%;" id="tblfoot" runat="server">
    <tr>
        <td style="width: 60%;">
            <webdiyer:AspNetPager ID="AspNetPager1" OnPageChanged="AspNetPager1_PageChanged"
                runat="server" PageIndexBoxType="DropDownList" ShowPageIndexBox="Always" AlwaysShow="True">
            </webdiyer:AspNetPager>
        </td>
        <td>
            总条数：<%=AspNetPager1.RecordCount%>
        </td>
        <td>
            总页数：<%=AspNetPager1.PageCount%>
        </td>
        <td>
            每页显示：<asp:DropDownList ID="ddlPageCount" AutoPostBack="true" runat="server" OnSelectedIndexChanged="ddlPageCount_SelectedIndexChanged">
                <asp:ListItem Value="5">5</asp:ListItem>
                <asp:ListItem Value="10" Selected="True">10</asp:ListItem>
                <asp:ListItem Value="30">30</asp:ListItem>
                <asp:ListItem Value="50">50</asp:ListItem>
                <asp:ListItem Value="100">100</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="footer" Runat="Server">
<script src="/js/common/My97DatePicker/WdatePicker.js" type="text/javascript" defer="defer"></script>
<script type="text/javascript">
    function openDetail(id) {
        OpenWindow("detail.aspx?id=" + id, "1000", "800");
    }
    function deleteBuylead(id) {
        if (confirm("Are You Sure?")) {
            $.post("buyleadDelete.ashx", { buyleadID: id }, function (rValue) {
                if (rValue != "-1") {
                    window.location.href = window.location.href;
                }
            });
        }
    }
</script>
</asp:Content>

